﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for Category
/// </summary>
public class Category
{
    public int Category_id { get; set; }
    public string Name { get; set; }
    public string Url { get; set; }
    public string Description { get; set; }
    public string Tag { get; set; }
    public int Order { get; set; }
    public bool Status { get; set; }
    public DateTime DateStart { get; set; }
    public DateTime DateUpdate { get; set; }
    public Category()
    {
        this.Category_id = 0;
        this.Name = "";
        this.Url = "";
        this.Description = "";
        this.Tag = "";
        this.Order = 1;
        this.Status = true;
        this.DateStart = DateTime.Now;
        this.DateUpdate = DateTime.Now;
    }
    public Category(DataRow dr)
    {
        this.Category_id = Convert.ToInt32(dr[0].ToString());
        this.Name = dr[1].ToString();
        this.Url = dr[2].ToString();
        this.Description = dr[3].ToString();
        this.Tag = dr[4].ToString();
        this.Order = Convert.ToInt32(dr[5].ToString());
        this.Status = Boolean.Parse(dr[6].ToString());
        this.DateStart = DateTime.Parse(dr[7].ToString());
        if (dr[8].ToString() != "" && dr[8].ToString() != null)
            this.DateUpdate = DateTime.Parse(dr[8].ToString());
    }
}